package ua.khpi.si.kit49.diploma.service;

import java.util.List;

import ua.khpi.si.kit49.diploma.db.dto.User;

/**
 * Interface user service
 * 
 * @author netstalk3r
 * 
 */
public interface RegistrationService {

	public static final String ROLE_ADMIN = "ROLE_ADMIN";
	public static final String ROLE_USER = "ROLE_USER";

	/**
	 * method for register new users
	 * 
	 * @param user
	 *            for registration
	 * @param isAdmin
	 *            define who are registering
	 */
	void registerUser(User user, Boolean isAdmin);

	/**
	 * method for getting user by id
	 * 
	 * @param Id
	 *            for getting user
	 * @return user with current id
	 */
	User getUserById(Integer id);

	/**
	 * method for getting user by email
	 * 
	 * @param email
	 *            for getting user
	 * @return user with current email
	 */
	User getUserByEmail(String email);

	/**
	 * method for getting user by login
	 * 
	 * @param username
	 *            for getting user
	 * @return user with current login
	 */
	User getUserByUsername(String username);

	/**
	 * method for getting all users
	 * 
	 * @return list with all users
	 */
	List<User> getAllUsers();

	/**
	 * method for save or update user
	 * 
	 * @param user
	 *            user for save or update
	 */
	void saveOrUpdateUser(User user);

	/**
	 * method for removing users
	 * 
	 * @param usersIds
	 *            list with users ids
	 */
	void removeUsers(List<Integer> usersIds);

	/**
	 * method for bun or unban users, it depends on parameter enabled
	 * 
	 * @param usersIds
	 *            list with user ids to ban or unban
	 * @param enabled
	 *            determine what to do
	 */
	void banUnbanUsers(List<Integer> usersIds, Boolean enabled);

	/**
	 * method for update current user
	 * 
	 * @param user
	 *            to update
	 */
	void updateUser(User user);

}
